import os
import torch
import json


class Config(object):
    def __init__(self):
        # 选择电脑路径
        self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
        self.train_path = r'D:\mydata\heima\heimaPY\KG\LSTM_CRF\data\train.txt'
        self.vocab_path = r'D:\mydata\heima\heimaPY\KG\LSTM_CRF\vocab\vocab.txt'
        self.tag2id = json.load(open(r'D:\mydata\heima\heimaPY\KG\LSTM_CRF\data\tag2id.json', encoding='utf-8'))
        self.embedding_dim = 512
        self.epochs = 5
        self.batch_size = 8
        self.hidden_dim = 256
        self.lr = 2e-3  # CRF的时候，lr可以小一点，比如1e-3
        self.dropout = 0.2
        self.model = 'BiLSTM_CRF'  # 也可以为BiLSTM



if __name__ == '__main__':
    config = Config()
    print(config.device)
    print(config.tag2id)

